<style lang="scss" scoped>
  @import '../../styles/common/loading.less';
  .container{
    border: none !important;
    margin-top: 4px;
  }
  .el-col-offset-1 {
    margin-left: 0%;
  }
  .button_a {
    background-color: rgba(255, 138, 0, 1);
    border-color: rgba(255, 138, 0, 1);

  }
  .col_a {
    margin-left: 2%;
  }
  .el-card {
    height: 200px;
  }

  .el-button--primary {
    background-color: rgba(255, 138, 0, 1);
    border-color: rgba(255, 138, 0, 1);
  }
</style>
<template>
    <div>
        <!-- 调查任务申请页面 -->
        <div class="container">
            <el-form :model="formInline" ref="formInline" :rules="rules" class="select-submit-form">
                <!--                        第一行-->
                <el-row type="flex">
                  <el-col :span="8">
                    <el-form-item prop="caseNo" label="大病赔案号">
                      <el-input  v-model="formInline.caseNo"></el-input>
                    </el-form-item>
                  </el-col>
                    <el-col :span="8" >
                        <el-form-item prop="insuredName" label="被保险人">
                            <el-input  v-model="formInline.insuredName"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8" >
                        <el-form-item prop="documentNo" label="证件号" style="white-space:nowrap;">
                            <el-input v-model="formInline.documentNo"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <!--                    第二行-->
                <el-row>
                  <el-col :span="24">
                    <div class="select-btn-group">
                      <el-button type="primary" size="medium"  @click="onSubmitResearchStart()">查询</el-button>
                      <el-button type="primary" size="medium" @click="handleReset">重置</el-button>
                      <!-- <el-button type="primary" size="medium" @click="sponsor" >发起調查</el-button> -->
                    </div>
                  </el-col>
                </el-row>
            </el-form>
            <el-table
              :data="seeDoc"
              class="table"
              ref="multipleTable"
              header-cell-class-name="table-header"
              @selection-change="selectSeeDoc"
              style="margin: 30px 0;border: 1px solid #d6d9d8;"
              v-loading="loading"
              element-loading-text="Loading....."
            >
              <!--                <el-table-column type="selection" label="序号" width="55" align="center"></el-table-column>-->
              <el-table-column prop="" label="大病赔案号"  align="center">
                <template slot-scope="scope" >
                  <a @click="applicant(scope.row)" style="color: #1e99f9;cursor: pointer">{{ scope.row.caseNo }}</a>
                </template>
              </el-table-column>
              <el-table-column prop="policyNo" label="保单号" align="center"></el-table-column>
              <el-table-column prop="insuredName" label="被保险人" align="center"></el-table-column>
              <el-table-column prop="medicalInsuranceNo" label="社/医保号" align="center"></el-table-column>
              <el-table-column prop="documentNo" label="证件号" align="center"></el-table-column>
              <el-table-column prop="damageDate" label="出险时间" align="center"></el-table-column>
              <el-table-column prop="flowInTime" label="流入时间" align="center"></el-table-column>
            </el-table>
            <div class="pagination" v-if="this.seeDoc.length!==0">
              <div class="index_page">
                <el-pagination :current-page="pagination.currentPage" :page-size="pagination.rowsNumber"
                               :page-sizes="[10, 20, 50, 100]"
                               :total="pagination.totalPage" background layout="prev, pager, next,sizes,total,jumper"
                               @size-change="handleSizeChange" @current-change="queryFun">
                </el-pagination>
              </div>
            </div>
        </div>
    </div>
</template>

<script>
  import * as api from '@/api/baseDate'
  export default {
  name: 'researchStart',
  data() {
    return {
      loading: false,
      pagination: {
        currentPage: 1, // 当前页
        rowsNumber: 10, // 每页条数
        totalPage: 0 // 总条数
      },
      formInline: {},
      dialogFormVisible: false,
      sponsorSurvey: {},
      seeDoc: [],
    };
  },
  created() {
  },
  methods: {
     selectSeeDoc(row){
        this.sponsorSurvey=row;
      },
    applicant(row){
      this.sponsorSurvey=row,
      this.$router.push({
        name: 'sponsorSurvey',
        query: {sponsorSurvey: JSON.stringify(this.sponsorSurvey)}
      })
    },
    // 按条件查询
    onSubmitResearchStart() {
      var data = {
        "caseNo": this.formInline.caseNo,
        "insuredName": this.formInline.insuredName,
        "documentNo": this.formInline.documentNo,
        "pageNum":this.pagination.currentPage,
        "pageSize":this.pagination.rowsNumber,
      }
      this.loading = true;
      api.getQuerySurveyTask(data
      ).then(res => {
        this.loading = false;
        this.seeDoc = res.data.list;
        this.pagination.totalPage=res.data.total;
      })
    },
    // 重置
    handleReset(){

    },
    handleSizeChange(pageSize){ // 改变当前页条数事件
      this.pagination.rowsNumber=pageSize
      this.onSubmitResearchStart();
      /* let pageIndex = this.pagination.currentPage;
       this.querySettleAuditTaskList(pageIndex,pageSize);*/
    },
    queryFun(pageNum){ // 改变当前页事件
      this.pagination.currentPage=pageNum
      this.onSubmitResearchStart();
      /* let rowsNumber = this.pagination.rowsNumber;
       this.querySettleAuditTaskList(pageNum,rowsNumber);*/
    },
  }
};
</script>